home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0769B.ZIP / DRAFT2.STD < prev    next >
Text File  |  1987-10-06  |  30KB  |  1,330 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Memorandum to:  Dbase Community
  19.  
  20. From:           Standards Committee
  21. Date:           
  22. Subject:        Draft Syntax 
  23.  
  24. This  is  the  Draft 2 syntax,  as compiled so  far.   It  sticks 
  25. closely  to Ashton-Tate's dBASE III Plus as implemented,  not  as 
  26. documented.  
  27.  
  28. Items not resolved in committee are noted with a `?' on the left.  
  29. Of course,  we solicit your comments and suggestions on the whole 
  30. standard, not merely those items.
  31.  
  32. Please forward your comments to Sharon Davidson at this office.
  33.  
  34.  
  35.  
  36. .pa
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. Note:  the committee formally requested Ashton-Tate's comments on 
  53. the  use  of  the  term "Standard  Dbase"  to  name  the  generic 
  54. language.
  55.  
  56. Ashton-Tate  withdrew  its  observer from the  committee  and  is 
  57. referring all calls on this subject to its legal department.   In 
  58. an  informal discussion with the committee chairman,  an  Ashton-
  59. Tate attorney expressed serious concern over the committee's work 
  60. infringing  on Ashton-Tate's proprietary rights to its dBASE  (r) 
  61. trademark.   A formal letter raising these concerns was promised.  
  62. To date, however, that letter has not been received.
  63.  
  64. We  presume  that  Ashton-Tate will oppose the use  of  "Standard 
  65. Dbase."
  66.  
  67. .pa
  68.  
  69.  
  70. Contents:
  71.  
  72. 1       Purpose
  73.  
  74. 3       Interactive and non-interactive implementations
  75.  
  76. 4       Syntax of this specification
  77.  
  78. 5       Miscellaneous
  79.  
  80. 6       Character set
  81.  
  82. 7       Components of statements
  83.  
  84. 7         Keywords
  85.  
  86. 12        Constants
  87.  
  88. 13        Fields and memory variables
  89.  
  90. 14        Functions
  91.  
  92. 16        Expressions
  93.  
  94. 18        Other components
  95.  
  96. 23      Statements
  97.  
  98. 24        Simple statements
  99.  
  100. 32        Block statements
  101.  
  102. 33        Program statements
  103.  
  104. 34      Programs
  105.  
  106.  
  107.  
  108.  
  109.  
  110. .pa
  111. Standard Dbase
  112.  
  113.  
  114.  
  115.  
  116. Purpose:
  117.  
  118.  
  119. During  1978  and  1979 Wayne  Ratliff  implemented  JPLDIS  (Jet 
  120. Propulsion  Laboratories  Display  and  Information  System),   a 
  121. mainframe fourth generation data processing language, on an IMSAI 
  122. 8080,  an  early,  8  bit  microcomputer.   He  called  this  new 
  123. implementation Vulcan.   In 1980,  Wayne entered into a marketing 
  124. agreement with Ashton-Tate, a new software publishing firm.
  125.  
  126. Ashton-Tate  renamed  the product dBASE II and marketed  it  with 
  127. extraordinary success.  The Dbase language has been extended with 
  128. each new release of Ashton-Tate's product.  While the language is 
  129. only  one component of the product,  it is still a key component.  
  130. To date, Ashton-Tate has sold over 1.5 million dBASE products.
  131.  
  132. Dbase  became a de facto standard programming language  for  data 
  133. processing applications on microcomputers.   Other companies have 
  134. created  and  successfully marketed implementations of the  Dbase 
  135. language.   Today's  Dbase programmer can choose from a range  of 
  136. excellent compilers and interpreters.   Additionally,  the  Dbase 
  137. programmer  has  access to the broadest range of tools,  such  as 
  138. editors and code generators,  available in any fourth  generation 
  139. language.
  140.  
  141. The  proliferation of Dbase language implementations has led to a 
  142. number  of  inconsistencies between different vendors'  products.  
  143. These  are sometimes extensions to the  language,  and  sometimes 
  144. minor  variations in syntax.   We wish to strongly encourage  the 
  145. former and eliminate the latter.
  146.  
  147. To  that end,  we have created the attached specification of 1987 
  148. Standard   Dbase   for  both  interactive   and   non-interactive 
  149. implementations  of the language.   This is one part of  a  total 
  150. process.
  151.  
  152. Other  key  parts  include  a list of  current  extensions  being 
  153. considered  for inclusion in the language and a list  of  current 
  154. modifications  proposed in the standard.   Additionally,  we have 
  155. created  the  <committee>  to continue to  accept  proposals  for 
  156. extensions  and  modifications,  disseminate these  proposals  as 
  157. widely  as possible and,  with as much public input as  possible, 
  158. make changes to the Standard Dbase specification.
  159.  
  160. We  trust that the benefits of a dynamic standard will  encourage 
  161. even  more  widespread  use  of  the  Dbase  language  for   data 
  162. processing applications on microcomputers.  Additionally, we hope 
  163. to  encourage vendors to make Standard Dbase available on  larger 
  164. computers,  providing,  over time, a single language running from 
  165. the largest to the smallest computer.
  166.  
  167. We  wish to encourage vendors to extend the language.   We expect 
  168. that  the nature of the proposed addition will  sometimes  permit 
  169. vendors  to  propose a change prior to the release of a  product, 
  170. and,  in  other  instances,  concurrently with the release  of  a 
  171. product.  We strongly urge all vendors to adhere to the syntax in 
  172. the proposals for extensions when they implement features already 
  173. included in this list.
  174.  
  175. Finally,  we  encourage vendors to re-publish the Standard  Dbase 
  176. specification  with their documentation,  noting any  differences 
  177. and extensions.
  178.  
  179.  
  180.  
  181.  
  182. .pa
  183.  
  184. Interactive and non-interactive implementations
  185.  
  186. The   language  may  be  implemented  for  interactive  or   non-
  187. interactive use.   In interactive implementations,  a prompt mode 
  188. is available which allows the user to enter all simple statements 
  189. for  immediate  execution.   Additionally,  screen  displays  may 
  190. convey  additional  infomation,  in a manner  determined  by  the 
  191. vendor.
  192.  
  193. Certain   commands   are   only  relevant   in   an   interactive 
  194. implementation.   These  are  noted.   Use of these  commands  in 
  195. systems   which   may  later  be  run  under  a   non-interactive 
  196. implementation may produce erroneous results.
  197.  
  198. While   it   has  been  traditional  to   implement   interactive 
  199. interpreters and non-interactive compilers,  this need not be the 
  200. case.     Both   interactive   compilers   and    non-interactive 
  201. interpreters may be implemented.
  202.  
  203. Occasional  differences  between interactive and  non-interactive 
  204. implementations  are noted and should be avoided  by  programmers 
  205. who require portability.
  206.  
  207. Implementation of the interactive commands,  such as BROWSE,  are 
  208. vendor  specific.   A  program which includes  these  interactive 
  209. statements will provide the functional capability described,  but 
  210. it  should be assumed that all implementations will be different.  
  211.  
  212.  
  213. .pa
  214. Syntax of this specification:
  215.  
  216.   a | b -- either a or b
  217.  
  218.   [a]   -- null or a
  219.  
  220.   [a]... -- 0 or more a's (vendor defined maximums)
  221.  
  222.   [a]..n -- 0 through n a's
  223.  
  224.   <a> -- substitute an instance of a (mandatory)
  225.  
  226.   { } -- grouping, e.g. ` { a [b] } | c ' is ` a | ab | c '
  227.  
  228.    d  -- digit (0-9)
  229.  
  230.    l  -- letter (one of A through Z or a through z)
  231.  
  232.    c  -- any character (as permitted by the system -- see Character Set)
  233.  
  234.    UPPERCASE -- include as is (in either upper or lowercase)
  235.  
  236.  
  237. .pa
  238.  
  239. Miscellaneous:
  240.  
  241. The  language is not sensitive to upper or lowercase,  except  in 
  242. character  strings.    For  instance,   all  the  following   are 
  243. equivalent:
  244.  
  245.         DO WHILE
  246.         do while
  247.         Do While
  248.  
  249. Tabs  and  spaces may be used freely between  language  elements.  
  250. Blank lines may be used freely for clarity.
  251.  
  252. All  keywords  may be abbreviated to as few as  four  characters.  
  253. Characters following the fourth are,  however,  significant.  The 
  254. APPEND statement may be:
  255.  
  256.         APPEND
  257.         APPEN
  258.         APPE
  259.  
  260. On the other hand, APPENDING is not equivalent.
  261.  
  262. Keywords  are not reserved.   If there is a field named `append', 
  263. for instance:
  264.  
  265.         APPEND BLANK
  266.         REPLACE append WITH newvalue
  267.  
  268. is  syntactically  correct.    Again,  the  capitalization  is  a 
  269. convention not required by the syntax.
  270.  
  271. Clauses  beginning  with keywords have been  specified  in  their 
  272. conventional order.   However,  they may be written in any order.  
  273. The following are equivalent:
  274.  
  275.         LIST NEXT 20 FOR state = "CA" FIELDS name,zip
  276.         LIST NEXT 20 FIELDS name,zip FOR state = "CA"
  277.         LIST FOR state = "CA" NEXT 20 FIELDS name,zip
  278.         LIST FOR state = "CA" FIELDS name,zip NEXT 20
  279.         LIST FIELDS name,zip NEXT 20 FOR state = "CA"
  280.         LIST FIELDS name,zip FOR state = "CA" NEXT 20
  281.  
  282. .pa
  283.  
  284. Character set:
  285.  
  286. All  characters  permitted by the hardware system  is  available.  
  287. The following characters are part of the language syntax and must 
  288. have their ASCII byte values:
  289.  
  290.  
  291.         Letters A-Z and a-z
  292.         digits 0-9
  293.         + - * / ( ) ' " & @ # $ ^ = [ ] , ; < > ? ! _
  294.         carriage return, line feed, space, tab
  295.  
  296. A return ( <r> ) is:
  297.  
  298.         CHR(13) | CHR(10) | {CHR13)CHR(10)}
  299.  
  300. A positive integer ( <n> ) is:
  301.  
  302.         d[d]...
  303.  
  304. where at least one d is non-zero.
  305.  
  306.  
  307. .pa
  308.  
  309. Components of statements:
  310.  
  311. Keywords:
  312.  
  313. A  keyword  is one of the following,  delimited by at  least  one 
  314. space, tab, <r>, beginning or end of file.
  315.  
  316.         ?
  317.         ??
  318.         @
  319.         *
  320.         !
  321.         /A
  322.         /C
  323.         /D
  324.         ACCEPT
  325.         ADDITIVE
  326.         ALIAS
  327.         ALL
  328.         ALTERNATE
  329.         AMERICAN
  330.         ANSI
  331.         APPEND
  332.         ASSIST
  333.         AVERAGE
  334.         BEFORE
  335.         BELL
  336.         BLANK
  337.         BOTTOM
  338.         BRITISH
  339.         BROWSE
  340.         CALL
  341.         CANCEL
  342.         CARRY
  343.         CASE
  344.         CATALOG
  345.         CENTURY
  346.         CHANGE
  347.         CLEAR
  348.         COLOR
  349.         COMMAND
  350.         CONFIRM
  351.         CONSOLE
  352.         CONTINUE
  353.         COPY
  354.         COUNT
  355.         CREATE
  356.         DATABASES
  357.         DATE
  358.         DEBUG
  359.         DECIMALS
  360.         DEFAULT
  361.         DELETE
  362.         DELETED
  363.         DELIMITED
  364.         DELIMITERS
  365.         DEVICE
  366.         DIR
  367.         DISPLAY
  368.         DO
  369.         DOHISTORY
  370.         DOUBLE
  371.         ECHO
  372.         EDIT
  373.         EJECT
  374.         ELSE
  375.         ENDCASE
  376.         ENDDO
  377.         ENDIF
  378.         ENDTEXT
  379.         ENVIRONMENT
  380.         ERASE
  381.         ERROR
  382.         ESCAPE
  383.         EXACT
  384.         EXCEPT
  385.         EXIT
  386.         EXPORT
  387.         EXTENDED
  388.         FIELDS
  389.         FILE
  390.         FILTER
  391.         FIND
  392.         FIXED
  393.         FROM
  394.         FOR
  395.         FORMAT
  396.         FRENCH
  397.         FUNCTION
  398.         GERMAN
  399.         GET
  400.         GETS
  401.         GO
  402.         GOTO
  403.         HEADING
  404.         HELP
  405.         HISTORY
  406.         IF
  407.         IMPORT
  408.         INDEX
  409.         INSERT
  410.         INTENSITY
  411.         INTO
  412.         ITALIAN
  413.         JOIN
  414.         LABEL
  415.         LAST
  416.         LIKE
  417.         LIST
  418.         LOAD
  419.         LOCATE
  420.         LOOP
  421.         MASTER
  422.         MEMORY
  423.         MEMOWIDTH
  424.         MENUS
  425.         MESSAGE
  426.         MODIFY
  427.         MODULE
  428.         NEXT
  429.         NOEJECT
  430.         NOTE
  431.         OFF
  432.         ON
  433.         ORDER
  434.         OTHERWISE
  435.         PACK
  436.         PARAMETER
  437.         PATH
  438.         PICTURE
  439.         PLAIN
  440.         PRINT
  441.         PRIVATE
  442.         PROCEDURE
  443.         PUBLIC
  444.         QUERY
  445.         QUIT
  446.         RANDOM
  447.         RANGE
  448.         READ
  449.         RECALL
  450.         RECORD
  451.         REINDEX
  452.         RELATION
  453.         RELEASE
  454.         RENAME
  455.         REPLACE
  456.         REPORT
  457.         REST
  458.         RESTORE
  459.         RESUME
  460.         RETRY
  461.         RETURN
  462.         RUN
  463.         SAFETY
  464.         SAVE
  465.         SAY
  466.         SCREEN
  467.         SDF
  468.         SET
  469.         SKIP
  470.         SORT
  471.         STATUS
  472.         STEP
  473.         STORE
  474.         STRUCTURE
  475.         SUM
  476.         SUSPEND
  477.         TALK
  478.         TEXT
  479.         TITLE
  480.         TO
  481.         TOP
  482.         TOTAL
  483.         TYPE
  484.         TYPEAHEAD
  485.         UNIQUE
  486.         UPDATE
  487.         USE
  488.         VIEW
  489.         WAIT
  490.         WHILE
  491.         WITH
  492.         ZAP
  493.  
  494. .pa
  495. Constants:
  496.  
  497. Constants have the following forms:
  498.  
  499.   L -- logical
  500.        .T. | .F.
  501.  
  502.   N -- numeric
  503.        { { [+|-]d[d]...[.[d]...] } | { [+|-].d[d]... } }[{E|e}[+|-]n[n[n]]]
  504.  
  505.   C -- character string
  506.         '[c]..254' | "[c]..254" | [[c]..254]
  507.         (in the last case, the outer brackets are read literally, e.g. 
  508.   [string] == "string" )
  509.  
  510.   U -- unquoted string
  511.         [c]...
  512.         where no c is a space, tab, return or linefeed.
  513.  
  514.   F -- filename
  515.         as defined by the operating system
  516.  
  517. .pa
  518. Fields and memory variables:
  519.  
  520. (`var' is used to imply either,  `field' or `memvar' is used when 
  521. appropriate.)
  522.  
  523. Types: 
  524.   varD -- Date   
  525.   varL -- Logical
  526.   varN -- Numeric
  527.   varC -- Character string
  528.   fieldM -- Memo field
  529.  
  530. Memory variable name:
  531.  
  532.         [M->]l[d|l|_]..10
  533.  
  534.         delimited with space, tab, <r>, beginning or end of file,
  535.   expression operator or comma.  
  536.  
  537. The tenth character following the `l' is not significant.
  538.  
  539. Field name:
  540.  
  541.         [{A|B|C|D|E|F|G|H|I|J|<alias>}->]l[d|l|_]..10
  542.  
  543.         delimited with space, tab, <r>, beginning or end of file, 
  544.   expression operator or comma.
  545.  
  546. The tenth character following the `l' is not significant.
  547.  
  548.  
  549. .pa
  550. Functions:
  551.  
  552. Types: 
  553.   funD -- Date   
  554.   funL -- Logical
  555.   funN -- Numeric
  556.   funC -- Character string
  557.   funS -- Source code
  558.  
  559. Returns
  560. S       &<memvar> -- the contents of <memvar> are substituted in the source code
  561. N       ABS(<expN>) -- absolute value of expN
  562. N       ASC(<expC>) -- ASCII code for first letter of expC
  563. N       AT(<expC1>,<expC2>) -- location of expC1 within expC2, or 0 
  564. L       BOF() -- .true. if beginning of file
  565. C       CDOW(<expD>) -- day of week as a string ("Tuesday")
  566. C       CHR(<expN>) -- ASCII character (expN must be 0 to 255)
  567. C       CMONTH(<expD>) -- name of month as a string ("July")
  568. N       COL() -- column location of cursor
  569. D       CTOD(<expC>) -- converts expC, in form "mm/dd/yy" to date
  570. D       DATE() -- system date
  571. N       DAY(<expD>) -- day of month
  572. C       DBF() -- name of the database file in use (or null string)
  573. L       DELETED() -- .true. if record is marked for deletion
  574. N       DISKSPACE() -- available diskpace, in bytes
  575. N       DOW(<expD>) -- day of week (Sunday = 1)
  576. C       DTOC(<expD>) -- date to "mm/dd/yy" format string
  577. L       EOF() -- .true. if end of file
  578. N       ERROR() -- error number trapped by ON ERROR condition
  579. N       EXP(<expN>) -- 2.718... to the expN power
  580. C       FIELD(<expN>) -- name of the expNth field in the current DBF (or null)
  581. L       FILE(<expC>) -- .true. if expC names a file
  582. C       FKLABEL(<expN>) -- 
  583. N       FKMAX() -- maximum number of special function keys
  584. L       FOUND() -- .true. if last FIND, SEEK, LOCATE or CONTINUE succeeded.
  585. C       GETENV(<expC>) -- OS's environment variables
  586. varies  IIF(<expL>,<exp1>,<exp2>) -- if expL, exp1, else exp2
  587. N       INKEY() -- gets character from keyboard buffer
  588. N       INT(<expN>) -- truncates to integer ( 12.5 -> 12, -12.5 -> -12 )
  589. L       ISALPHA(<expC>) -- .true. if first character in expC is alphabetic
  590. L       ISCOLOR() -- .true. for color mode, .false. for monochrome
  591. L       ISLOWER(<expC>) -- .true. if first character of expC is lowercase
  592. C       LEFT(<expC>,<expN>) -- leftmost expN characters of expC
  593. N       LEN(<expN>) -- length of string 
  594. N       LOG(<expN>) -- natural logarithm
  595. C       LOWER(<expC>) -- expC in all lowercase
  596. C       LTRIM(<expC>) -- expC without leading blanks
  597. D       LUPDATE() -- date of last update of current DBF
  598. N       MAX(<expN1>,<expN2>) -- greater of expN1 and expN2
  599. C       MESSAGE() -- error message
  600. N       MIN(<expN1>,<expN2>) -- lesser of expN1 and expN2
  601. N       MOD(<expN1>,<expN2>) -- expN1 modulo expN2
  602. N       MONTH(<expD>) -- month
  603. C       NDX(<expN>) -- name of the expNth index (1 through 7) open with
  604.         current DBF
  605. C       OS() -- name of the operating system
  606. N       PCOL() -- current printer column
  607. N       PROW() -- current printer row
  608. N       READKEY() -- the key used to exit from full screen input
  609. N       RECCOUNT() -- number of records in current DBF
  610. N       RECNO() -- current record number
  611. N       RECSIZE() -- size of record, in bytes, in current DBF
  612. C       REPLICATE(<expC>,<expN>) -- repeats expC, expN times
  613. C       RIGHT(<expC>,<expN>) -- rightmost expN characters of expC
  614. N       ROUND(<expN1>,<expN2>) -- expN1 rounded to expN2 decimal places
  615. N       ROW() -- current screen cursor row
  616. C       RTRIM(<expC>) -- same as TRIM
  617. C       SPACE(<expN>) -- string of expN spaces
  618. N       SQRT(<expN>) -- square root of expN
  619. C       STR(<expN1>[,<expN2>[,<expN3]]>) 
  620.         expN1 as string, expN2 long, expN3 decimal places
  621. C       STUFF(<expC1>,<expN1>,<expN2>,<expC2>) 
  622.         stuff expC2 into expC1 at expN1 dropping expN2 characters
  623. C       SUBSTR(<expC>,<expN1>[,<expN2]>) 
  624.         expC from character expN1 for expN2 characters
  625. C       TIME() -- system times in hh:mm:ss format
  626. C       TRANSFORM(<exp>,<pic>) -- exp formatted according to picllll
  627. C       TRIM(<expC>) -- expC without trailing blanks 
  628. C       TYPE(<'expC'|expC>) -- type (C, D, L, N, U=unknown) of 'expC' 
  629.         or expC's contents
  630. C       UPPER(<expC>) -- expC in all uppercase
  631. N       VAL(<expC>) -- the numeric value of expC, or 0 if not numeric
  632. C       VERSION() -- name of current Dbase version
  633. N       YEAR(<expD>) -- year, e.g. 1987
  634.  
  635.  
  636.  
  637. .pa
  638. Expressions:
  639.  
  640. An expression has one of the following types:
  641.  
  642.   expD -- Date   
  643.   expL -- Logical
  644.   expN -- Numeric
  645.   expC -- Character string
  646.   expX -- date or numeric or character string (eXcept logical)
  647.  
  648. An expression has the following form:
  649.  
  650.    [ {+|-|.NOT.} ] { { <constant> | <var> | <fun> | <expression> } 
  651.    [ <operator> <expression> ] }  |  ( <expression> )  
  652.  
  653. Operators are:
  654.  
  655. Mathematical and string (in order of precedence):
  656. +, -    unary plus, negation 
  657. **, ^   exponentiation
  658. *, /    multiplication, division
  659. +, -    addition, subtraction, or string contatenation 
  660.  
  661. Comparison (no precedence):
  662.  <      less than
  663.  <=     less than or equal to
  664.  =      equal to
  665.  >=     greater than or equal to
  666.  >      greater than
  667.  <>, #  not equal to
  668.  $      substring ( a$b returns true if a is a substring in b )
  669.  
  670. Logical (in order of precedence):
  671.  .NOT.  logical not
  672.  .AND.  logical and
  673.  .OR.   logical or
  674.  
  675.  
  676. .pa
  677. Valid expression/operator combinations are:
  678.   .NOT. <expL>
  679.   [+|-] <expN>
  680.   <expN> <mathematical> <expN>
  681.   <expC> {+|-} <expC>
  682.   <expD> <comparison> <expD>
  683.   <expN> <comparison> <expN>
  684.   <expC> <comparison> <expC>
  685.   <expL> { .AND. | .OR. } <expL>
  686.   <expD> - <expD>
  687.   <expD> { + | - } <expN>
  688.   <expN> + <expD>
  689.  
  690. The  type  of  an  expression may differ from  the  type  of  its 
  691. components, as in:
  692.  
  693. .NOT. 2 + 2 <> 4
  694.  
  695. Precedence in evaluation is:
  696.         Within parentheses
  697.         Mathematical and string (as specified)
  698.         Comparison
  699.         Logical (as specified)
  700.  
  701. Evaluation is left to right if not otherwise specified.
  702.  
  703.  
  704. .pa
  705.  
  706. Other components of statements
  707.  
  708. Coordinates:
  709.  
  710. The screen is addressed by character sized rows and columns.  Row 
  711. 0, column 0 is the upper left. <coord> is specified by:
  712.  
  713.         <expN1>,<expN2>
  714.  
  715. Pictures:
  716.  
  717. Picture clauses format output and restrict input.  A <pic> is:
  718.  
  719.         PICTURE { { <functions>[<template>] } | <template> }
  720.  
  721.   <functions> are one or more symbols from the following list:
  722.  
  723.         A -- alphabetic characters only
  724.         B -- left justify numberss
  725.         C -- display CR after positive numbers
  726.         D -- American date format
  727.         E -- European date format
  728.         R -- literals in the template are not part of the data
  729.         S<n> -- scroll field within n characters
  730.         X -- display DB after negative numbers
  731.         Z -- display all blanks for a zero value
  732.         ! -- capital letters only
  733.         ( -- enclose negative numbers in parentheses
  734.  
  735. .pa
  736.   A <template> is a string composed of the following:
  737.  
  738.         A -- letters only
  739.         L -- logical value only
  740.         N -- letters or digits
  741.         X -- any character
  742.         Y -- Y, y, N or n only, with conversion to uppercase
  743.         9 -- digits only (leading sign allowed in numbers)
  744.         ! -- as X plus convert lowercase to uppercase
  745.         # -- digit or sign or blank
  746.         $ -- show `$' for leading zeros.
  747.         * -- show `*' for leading zeros.
  748.         , -- comma (suppressed on left)
  749.         . -- decimal point
  750.         x -- all other characters are constants 
  751.  
  752. Lists:
  753.  
  754. A list of x's, e.g. field list, has the following form:
  755.  
  756.         <x> [,x]...
  757.  
  758.  
  759. Filename:
  760.  
  761. A <filename> is:
  762.  
  763. An  unquoted character string recognized by the operating  system 
  764. as naming a logical file.
  765.  
  766.  
  767. Alias:
  768.  
  769. An <alias> is:
  770.  
  771.         <filename> | {var name}
  772.  
  773.  
  774. File specification:
  775.  
  776. A <file spec> is:
  777.  
  778. An  unquoted character string recognized by the operating  system 
  779. as specifying a group of files.
  780.  
  781.  
  782. Skeletons:
  783.  
  784. A  <skeleton>  is  an  unquoted  character  string  used  by  the 
  785. operating system as part of a <file spec>.   For instance:  a?b*, 
  786. in DOS.
  787.  
  788.  
  789. OS commands:
  790.  
  791. An  <OS command> is an unquoted character string which is a valid 
  792. command to the operating system.
  793.  
  794.  
  795. Storage areas:
  796.  
  797. A <storage area> is:
  798.  
  799. An  unquoted  string naming a logical or physical area  for  data 
  800. storage, as defined by the operating system.  For instance, C: or 
  801. \path\ in DOS.
  802.  
  803.  
  804. OS devices:
  805.  
  806. An <OS device> is:
  807.  
  808. An  unquoted  string naming a logical  or  physical  input/output 
  809. device, as defined by the operating system.
  810.  
  811.  
  812. Procedure name:
  813.  
  814. A <procedure name> is:
  815.  
  816.         <filename> | <var name>
  817.  
  818.  
  819. Date type:
  820.  
  821. A <date type> is:
  822.  
  823.   AMERICAN | ANSI | BRITISH | FRENCH | GERMAN | ITALIAN 
  824.  
  825.  
  826. Filetype:
  827.  
  828. A <type> is an unquoted string from a vendor defined list.
  829.  
  830.  
  831. Type clause:
  832.  
  833. A <type clause> is:
  834.  
  835.   { TYPE <type> } | { SDF [ DELIMITED [ WITH {SPACE|c} ] ] }
  836.  
  837.  
  838. Scopes:
  839.  
  840. A  scope clause controls the range of operation of some commands.  
  841. A <scope> is:
  842.  
  843.         ALL | { NEXT <n> } | { RECORD <expN> } | REST
  844.  
  845.  
  846. Condition clause:
  847.  
  848. A condition clause is:
  849.  
  850. { WHILE <expL> [ FOR <expL> ] } | { FOR <expL> [ WHILE <expL> ] }
  851.  
  852.  
  853. Scope & condition:
  854.  
  855. A <scope & condition> is one, two or all of:
  856.  
  857.         <scope>
  858.         WHILE <expL>
  859.         FOR <expL>
  860.  
  861.  
  862. Get clause:
  863.  
  864. A <get> is:
  865.  
  866.         { GET <var> [<pic>] } |
  867.         { GET <varN> [<pic>] [RANGE <expN1,expN2>] } |
  868.         { GET <varD> [<pic>] [RANGE <expD1,expD2>] }
  869.  
  870.  
  871. Comments:
  872.  
  873. A comment is any character string.  Comments are ignored.
  874.  
  875. .pa
  876. Statements:
  877.  
  878. A <statement> is:
  879.  
  880.          { c[c]..253 <r> } | { c[c]..251 && [comment] <r> }
  881.  
  882. in one of the following forms.
  883.  
  884. If  the  statement  is  a  comment  (*  or  NOTE)  the  remaining 
  885. characters are ignored.
  886.  
  887. ? Note:   This gives `*' precedence over `;'.  Continuing a comment 
  888. requires a new `*' -- unlike Ashton-Tate's implementation.
  889.  
  890. If the last non-whitespace character is a `;' the `;', whitespace 
  891. and return are ignored.  (The statement continues on the next line.)
  892.  
  893. Characters following `&&' are ignored (available for comments).
  894.  
  895. All statements,  except the alternate form of STORE, start with a 
  896. keyword.
  897.  
  898. A  <statement  name> is the keyword which begins  the  statement.  
  899. Both:
  900.         STORE <exp> TO <memvar> and
  901.         <memvar> = <exp>
  902. are considered as a STORE statement.
  903.  
  904. A <statement> is:
  905.  
  906.         <simple statement> | <block statement> | <program statement>
  907.  
  908.  
  909.  
  910.  
  911. .pa
  912.  
  913. A <simple statement> is one of the following:
  914.  
  915.  
  916. ? <exp list>  
  917. Output CR/LF and the value of the expressions.
  918.  
  919.  
  920. ?? <exp list> 
  921. Output the value of the expressions.  
  922.  
  923.  
  924. @ <coord> CLEAR TO <coord>
  925.  
  926.  
  927. @ <coord> <get>
  928.  
  929.  
  930. @ <coord> SAY <exp> [<pic>] [ <get> ]
  931.  
  932.  
  933. @ <coord> TO <coord> [DOUBLE]
  934.  
  935.  
  936. ACCEPT [<expC>] TO <memvar>
  937.  
  938.  
  939. APPEND 
  940. interactive
  941.  
  942.  
  943. APPEND BLANK
  944.  
  945.  
  946. APPEND FROM <filename> [<scope>] [<type clause>]
  947.  
  948.  
  949. ASSIST <command list>
  950. interactive
  951.  
  952.  
  953. AVERAGE <exp list> [<scope & condition>] [TO <memvar list>]
  954.  
  955.  
  956. BROWSE 
  957. interactive
  958.  
  959.  
  960. CALL <filename> [ WITH { <expC> | <memvar> } ]
  961. interactive
  962.  
  963.  
  964. CANCEL
  965. interactive differs from non-interactive 
  966.  
  967.  
  968. CHANGE [<scope & condition>] [FIELDS <field list>]
  969.  
  970.  
  971. CLEAR [ { ALL | FIELDS | GETS | MEMORY | TYPEAHEAD } ] 
  972.  
  973.  
  974. CLOSE { ALL | ALTERNATE | DATABASES | FORMAT | INDEX | PROCEDURE }
  975.  
  976.  
  977. CONTINUE
  978.  
  979.  
  980. COPY FILE <filename> TO <filename>
  981.  
  982.  
  983. COPY STRUCTURE TO <filename> [ FIELDS <field list> ]
  984.  
  985.  
  986. COPY TO <filename> [ <scope & condition> ] [FIELDS <field list> 
  987. [<type clause>]
  988.  
  989.  
  990. COPY TO <filename> STRUCTURE EXTENDED
  991.  
  992.  
  993. COUNT [ <scope & condition> ] [ TO <memvar> ]
  994.  
  995.  
  996. CREATE <filename>
  997.  
  998.  
  999. CREATE <filename> FROM <filename>
  1000.  
  1001.  
  1002. CREATE { LABEL | QUERY | REPORT | SCREEN | VIEW } <filename>
  1003. CREATE VIEW <filename> FROM ENVIRONMENT
  1004. interactive
  1005.  
  1006.  
  1007. DELETE [ <scope & condition> ]
  1008.  
  1009.  
  1010. DELETE FILE <filename>
  1011.  
  1012.  
  1013. DIR <file spec>
  1014. interactive
  1015.  
  1016.  
  1017. DISPLAY [ <scope & condition> ] [ <exp list> ] [OFF] [TO PRINT]
  1018.  
  1019.  
  1020. DISPLAY { { HISTORY [LAST <expN>] } | MEMORY | STATUS | STRUCTURE } 
  1021. [TO PRINT]
  1022. interactive
  1023.  
  1024.  
  1025. DO <procedure name> [20WITH <parameter list> ]
  1026.  
  1027.  
  1028. EDIT [ <scope & condition> ] [FIELDS <field list>] 
  1029. interactive
  1030.  
  1031.  
  1032. EJECT
  1033.  
  1034.  
  1035. ERASE <filename>
  1036.  
  1037.  
  1038. EXPORT TO <filename> [ TYPE <type> ]
  1039.  
  1040.  
  1041. FIND <character string> | <n>
  1042.  
  1043.  
  1044. GO[TO] { BOTTOM | TOP | <expN> }
  1045.  
  1046.  
  1047. HELP [<keyword>]
  1048. interactive
  1049.  
  1050.  
  1051. IMPORT FROM <filename> TYPE <type>
  1052.  
  1053.  
  1054. INDEX ON <expX> TO <filename> [ UNIQUE ]
  1055.  
  1056.  
  1057. ? The INPUT statement is omitted
  1058.  
  1059.  
  1060. INSERT [BEFORE]
  1061. interactive
  1062.  
  1063.  
  1064. INSERT BLANK [BEFORE]
  1065.  
  1066.  
  1067. JOIN WITH <alias> TO <newfile> FOR <expL> [ FIELDS <field list> ]
  1068.  
  1069.  
  1070. LABEL FORM <filename> [<scope & condition>] [NOEJECT] 
  1071. [ { { TO PRINT } | { TO FILE <filename> } } ]
  1072.  
  1073.  
  1074. LIST [ <scope & condition> ] [ <exp list> ] [OFF] [TO PRINT]
  1075.  
  1076.  
  1077. LIST { { HISTORY [ LAST <expN> } | MEMORY } [ TO PRINT ]
  1078. interactive
  1079.  
  1080.  
  1081. LIST { STATUS | STRUCTURE }
  1082. interactive
  1083.  
  1084.  
  1085. LOAD <filename>
  1086.  
  1087.  
  1088. LOCATE [ <scope & condition> ]
  1089.  
  1090.  
  1091. LOOP -- see DO WHILE
  1092.  
  1093.  
  1094. MODIFY { STRUCTURE | ENVIRONMENT }
  1095. interactive
  1096.  
  1097.  
  1098. MODIFY { COMMAND | LABEL | QUERY | REPORT | SCREEN | VIEW } <filename>
  1099. interactive
  1100.  
  1101.  
  1102. { NOTE | * } [comment]
  1103.  
  1104.  
  1105. ON { ERROR | ESCAPE } <simple statement>
  1106.  
  1107.  
  1108. PACK
  1109.  
  1110.  
  1111. PRIVATE [ ALL [ { LIKE | EXCEPT } <skeleton> ] ] | [ <memvar list> ]
  1112.  
  1113.  
  1114. PUBLIC <memvar list>
  1115.  
  1116.  
  1117. QUIT
  1118.  
  1119.  
  1120. READ [SAVE]
  1121.  
  1122.  
  1123. RECALL [ <scope & condition> ]
  1124.  
  1125.  
  1126. REINDEX
  1127.  
  1128.  
  1129. RELEASE <memvar list> | { ALL [ { LIKE | EXCEPT } <skeleton> ] } | 
  1130. { MODULE <module name> }
  1131.  
  1132.  
  1133. RENAME <filename> TO <filename>
  1134.  
  1135.  
  1136. REPLACE [ <scope & condition> ] <field> WITH <exp> [, <field> WITH <exp> ]...  
  1137.  
  1138. REPORT FORM <filename> [ <scope & condition> ] [ PLAIN ] [ HEADING <expC> ] 
  1139. [ NOEJECT ] [ { { TO PRINT } | { TO FILE <filename> } } ]
  1140.  
  1141.  
  1142. RESTORE FROM <filename> [ ADDITIVE ]
  1143.  
  1144.  
  1145. RESUME
  1146. interactive
  1147.  
  1148.  
  1149. RETRY
  1150.  
  1151.  
  1152. RETURN [ TO MASTER ]
  1153.  
  1154.  
  1155. { RUN | ! } < OS command >
  1156.  
  1157.  
  1158. SAVE TO <filename> [ALL { LIKE | EXCEPT } <skeleton> ]
  1159.  
  1160.  
  1161. SET { ALTERNATE | (boldface)BELL | CARRY | (boldface)CATALOG | CENTURY | 
  1162. CONFIRM | (boldface)CONSOLE | DEBUG | DELETED | DELIMITERS | DOHISTORY | 
  1163. ECHO | (boldface)ESCAPE | EXACT | FIELDS | FIXED | (boldface)HEADING | 
  1164. (boldface)HELP | (boldface)HISTORY | (boldface)INTENSITY | (boldface)MENUS | 
  1165. PRINT | (boldface)SAFETY | (boldface)STATUS | STEP | (boldface)TALK | 
  1166. (boldface)TITLE | UNIQUE } { ON | OFF }
  1167.  
  1168.  
  1169. (boldface)Boldface = default is ON.  CARRY, CATALOG, DEBUG, DOHISTORY, ECHO, 
  1170. HELP, HISTORY, MENUS, SAFETY, STATUS, STEP, TALK and TITLE are interactive.
  1171.  
  1172.  
  1173. SET { ALTERNATE | CATALOG | FORMAT | PROCEDURE | VIEW } TO <filename>
  1174. CATALOG is interactive.
  1175.  
  1176.  
  1177. SET COLOR TO [ <standard> [, <enhanced> [, <border> ] ] ]
  1178.  
  1179.  
  1180. SET DATE <date type>
  1181.  
  1182.  
  1183. SET { DECIMALS | MEMOWIDTH | ORDER | TYPEAHEAD } TO <expN>
  1184.  
  1185.  
  1186. SET DEFAULT TO <storage area>
  1187.  
  1188.  
  1189. SET DELIMITERS TO { <expC> | DEFAULT }
  1190.  
  1191.  
  1192. SET DEVICE TO { SCREEN | PRINT }
  1193.  
  1194.  
  1195. SET FIELDS TO { <field list> | ALL }
  1196.  
  1197.  
  1198. SET FILTER TO [ { FILE <filename> } | <expL> ]
  1199. ?  Under  the  Ashton-Tate interpreter,  the keyword  TO  may  be 
  1200. omitted to turn a filter off.
  1201.  
  1202.  
  1203. SET FUNCTION <expC> TO <expC>
  1204.  
  1205.  
  1206. SET INDEX TO [ <file list> ]
  1207.  
  1208.  
  1209. SET MESSAGE TO <expC>
  1210. interactive
  1211.  
  1212.  
  1213. SET PATH TO <storage area list>
  1214.  
  1215.  
  1216. SET PRINTER TO { <OS device> | <filename> }
  1217.  
  1218.  
  1219.  
  1220. SET RELATION TO [ { <expX> | <expN> } INTO <alias> ]
  1221.  
  1222.  
  1223. SKIP [ <expN> ]
  1224.  
  1225.  
  1226. SORT TO <filename> ON <field> [/A] [/C] [/D] [, <field> [/A] [/C] [/D] ]...
  1227.  
  1228.  
  1229. { STORE <exp> TO <memvar list> } | { <memvar> = <exp> }
  1230.  
  1231.  
  1232. SUM [ <scope> ] [ <exp list> ] TO [ <memvar list> ] [ <condition clause> ]
  1233.  
  1234.  
  1235. SUSPEND
  1236. interactive
  1237.  
  1238.  
  1239. TOTAL TO <filename> ON <key> [ <scope & condition> ] [ FIELDS <field list> ] 
  1240.  
  1241.  
  1242. TYPE <filename> [ TO PRINT ]
  1243.  
  1244.  
  1245. UPDATE ON <expX> FROM <alias> REPLACE <field> WITH <exp> [, <field> WITH 
  1246. <exp> ]... [RANDOM]
  1247.  
  1248.  
  1249. USE [ <filename> [ INDEX <file list> ] [ ALIAS <alias> ] ]
  1250.  
  1251.  
  1252. WAIT [ <expC> ] [ TO <memvar> ]
  1253.  
  1254.  
  1255. ZAP
  1256.  
  1257.  
  1258.  
  1259. .pa
  1260. Block statements:
  1261.  
  1262. Block statements are one of the following:
  1263.  
  1264. (<statements>, as used below, means any combination of simple and 
  1265. block statements.
  1266.  
  1267. DO CASE
  1268.         CASE <expL>
  1269.                 <statements>
  1270.         [CASE <expL2>
  1271.                 <statements>]...
  1272.         [OTHERWISE [comment]
  1273.                 <statements>]
  1274. ENDCASE [comment]
  1275.  
  1276.  
  1277. DO WHILE <expL>
  1278.         statements
  1279.         [ LOOP
  1280.         statements]
  1281.         [ EXIT [comment] ]
  1282.         [statements]
  1283. ENDDO [comment]
  1284.  
  1285. LOOP and EXIT lines may appear repeatedly and in any order.
  1286.  
  1287.  
  1288. IF <expL>
  1289.         <statements>
  1290.     [ ELSE 
  1291.         <statements> ]
  1292. ENDIF [comment]
  1293.  
  1294.  
  1295. TEXT
  1296.   [c]...
  1297. ENDTEXT
  1298.  
  1299. The characters here may include <r> characters.
  1300.  
  1301.  
  1302. .pa
  1303.  
  1304. Program statement:
  1305.  
  1306. Program statements are one of the following:
  1307.  
  1308. PARAMETER <memvar list>
  1309.  
  1310.  
  1311. PROCEDURE <procedure name>
  1312.  
  1313.  
  1314. .pa
  1315. Programs:
  1316.  
  1317. As  used here,  <statements> means any combination of simple  and 
  1318. block statements.
  1319.  
  1320. { { beginning of file } | [ <PROCEDURE statement> ] } 
  1321. [ <PARAMETER statement> ] 
  1322. <statements>
  1323.  
  1324. The  program  ends  with  the last  statement  prior  to  another 
  1325. PROCEDURE statement, or with the end of the file.
  1326.  
  1327. The simple statements CANCEL, RETURN and QUIT may appear anywhere 
  1328. in the statements portion of the program.
  1329.  
  1330.